﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Maticsoft.DBUtility;//Please add references
namespace EnterpriseFund.DAL
{
    /// <summary>
    /// 数据访问类:DSDJ_NSRXX
    /// </summary>
    public partial class DSDJ_NSRXX
    {
        public DSDJ_NSRXX()
        { }
        #region  BasicMethod

  

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.DSDJ_NSRXX DataRowToModel(DataRow row)
        {
            EnterpriseFund.Model.DSDJ_NSRXX model = new EnterpriseFund.Model.DSDJ_NSRXX();
            if (row != null)
            {
                if (row["NSRDZDAH"] != null && row["NSRDZDAH"].ToString() != "")
                {
                    model.NSRDZDAH = decimal.Parse(row["NSRDZDAH"].ToString());
                }
                if (row["WSPZXH"] != null && row["WSPZXH"].ToString() != "")
                {
                    model.WSPZXH = decimal.Parse(row["WSPZXH"].ToString());
                }
                if (row["NSRSBH"] != null)
                {
                    model.NSRSBH = row["NSRSBH"].ToString();
                }
                if (row["NSRBM"] != null)
                {
                    model.NSRBM = row["NSRBM"].ToString();
                }
                if (row["NSRMC"] != null)
                {
                    model.NSRMC = row["NSRMC"].ToString();
                }
                if (row["FDDBRMC"] != null)
                {
                    model.FDDBRMC = row["FDDBRMC"].ToString();
                }
                if (row["FRZJLX_DM"] != null)
                {
                    model.FRZJLX_DM = row["FRZJLX_DM"].ToString();
                }
                if (row["ZJHM"] != null)
                {
                    model.ZJHM = row["ZJHM"].ToString();
                }
                if (row["SCJYDZ"] != null)
                {
                    model.SCJYDZ = row["SCJYDZ"].ToString();
                }
                if (row["BSRMC"] != null)
                {
                    model.BSRMC = row["BSRMC"].ToString();
                }
                if (row["DHHM"] != null)
                {
                    model.DHHM = row["DHHM"].ToString();
                }
                if (row["LSGX_DM"] != null)
                {
                    model.LSGX_DM = row["LSGX_DM"].ToString();
                }
                if (row["HY_DM"] != null)
                {
                    model.HY_DM = row["HY_DM"].ToString();
                }
                if (row["DJZCLX_DM"] != null)
                {
                    model.DJZCLX_DM = row["DJZCLX_DM"].ToString();
                }
                if (row["HZDJRQ"] != null && row["HZDJRQ"].ToString() != "")
                {
                    model.HZDJRQ = DateTime.Parse(row["HZDJRQ"].ToString());
                }
                if (row["QYKJZD_DM"] != null)
                {
                    model.QYKJZD_DM = row["QYKJZD_DM"].ToString();
                }
                if (row["SWDJBLX_DM"] != null)
                {
                    model.SWDJBLX_DM = row["SWDJBLX_DM"].ToString();
                }
                if (row["SWDJZLX_DM"] != null)
                {
                    model.SWDJZLX_DM = row["SWDJZLX_DM"].ToString();
                }
                if (row["NSRZT_DM"] != null)
                {
                    model.NSRZT_DM = row["NSRZT_DM"].ToString();
                }
                if (row["ZGSWRY_DM"] != null)
                {
                    model.ZGSWRY_DM = row["ZGSWRY_DM"].ToString();
                }
                if (row["JDXZ_DM"] != null)
                {
                    model.JDXZ_DM = row["JDXZ_DM"].ToString();
                }
                if (row["ZZSNSRLX_DM"] != null)
                {
                    model.ZZSNSRLX_DM = row["ZZSNSRLX_DM"].ToString();
                }
                if (row["GSYLB_DM"] != null)
                {
                    model.GSYLB_DM = row["GSYLB_DM"].ToString();
                }
                if (row["NSRXYDJ_DM"] != null)
                {
                    model.NSRXYDJ_DM = row["NSRXYDJ_DM"].ToString();
                }
                if (row["QYGM_DM"] != null)
                {
                    model.QYGM_DM = row["QYGM_DM"].ToString();
                }
                if (row["CYLX_DM"] != null)
                {
                    model.CYLX_DM = row["CYLX_DM"].ToString();
                }
                if (row["XZQH_YSFPBL_DM"] != null)
                {
                    model.XZQH_YSFPBL_DM = row["XZQH_YSFPBL_DM"].ToString();
                }
                if (row["HGDM"] != null)
                {
                    model.HGDM = row["HGDM"].ToString();
                }
                if (row["ZJG_BZ"] != null)
                {
                    model.ZJG_BZ = row["ZJG_BZ"].ToString();
                }
                if (row["NSR_SWJG_DM"] != null)
                {
                    model.NSR_SWJG_DM = row["NSR_SWJG_DM"].ToString();
                }
                if (row["SWJG_DM"] != null)
                {
                    model.SWJG_DM = row["SWJG_DM"].ToString();
                }
                if (row["LRR_DM"] != null)
                {
                    model.LRR_DM = row["LRR_DM"].ToString();
                }
                if (row["LRRQ"] != null && row["LRRQ"].ToString() != "")
                {
                    model.LRRQ = DateTime.Parse(row["LRRQ"].ToString());
                }
                if (row["XGR_DM"] != null)
                {
                    model.XGR_DM = row["XGR_DM"].ToString();
                }
                if (row["XGRQ"] != null && row["XGRQ"].ToString() != "")
                {
                    model.XGRQ = DateTime.Parse(row["XGRQ"].ToString());
                }
                if (row["HDFS_DM"] != null)
                {
                    model.HDFS_DM = row["HDFS_DM"].ToString();
                }
                if (row["DSZ"] != null)
                {
                    model.DSZ = row["DSZ"].ToString();
                }
                if (row["NSRMC_JC"] != null)
                {
                    model.NSRMC_JC = row["NSRMC_JC"].ToString();
                }
                if (row["ZJL"] != null)
                {
                    model.ZJL = row["ZJL"].ToString();
                }
                if (row["QYFR_DM"] != null)
                {
                    model.QYFR_DM = row["QYFR_DM"].ToString();
                }
                if (row["FZDW_MC"] != null)
                {
                    model.FZDW_MC = row["FZDW_MC"].ToString();
                }
                if (row["FZHM"] != null)
                {
                    model.FZHM = row["FZHM"].ToString();
                }
                if (row["JYFS_DM"] != null)
                {
                    model.JYFS_DM = row["JYFS_DM"].ToString();
                }
                if (row["NSRLB_DM"] != null)
                {
                    model.NSRLB_DM = row["NSRLB_DM"].ToString();
                }
                if (row["GDGGBZ"] != null)
                {
                    model.GDGGBZ = row["GDGGBZ"].ToString();
                }
                if (row["KGFS_DM"] != null)
                {
                    model.KGFS_DM = row["KGFS_DM"].ToString();
                }
                if (row["HYDL_DM"] != null)
                {
                    model.HYDL_DM = row["HYDL_DM"].ToString();
                }
                if (row["BF_SJQYXZ_DM"] != null)
                {
                    model.BF_SJQYXZ_DM = row["BF_SJQYXZ_DM"].ToString();
                }
            }
            return model;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select NSRDZDAH,WSPZXH,NSRSBH,NSRBM,NSRMC,FDDBRMC,FRZJLX_DM,ZJHM,SCJYDZ,BSRMC,DHHM,LSGX_DM,HY_DM,DJZCLX_DM,HZDJRQ,QYKJZD_DM,SWDJBLX_DM,SWDJZLX_DM,NSRZT_DM,ZGSWRY_DM,JDXZ_DM,ZZSNSRLX_DM,GSYLB_DM,NSRXYDJ_DM,QYGM_DM,CYLX_DM,XZQH_YSFPBL_DM,HGDM,ZJG_BZ,NSR_SWJG_DM,SWJG_DM,LRR_DM,LRRQ,XGR_DM,XGRQ,HDFS_DM,DSZ,NSRMC_JC,ZJL,QYFR_DM,FZDW_MC,FZHM,JYFS_DM,NSRLB_DM,GDGGBZ,KGFS_DM,HYDL_DM,BF_SJQYXZ_DM ");
            strSql.Append(" FROM DJ_NSRXX ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            return DbHelperOra.Query(strSql.ToString());
        }

        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select ");
            if (Top > 0)
            {
                strSql.Append(" top " + Top.ToString());
            }
            strSql.Append(" NSRDZDAH,WSPZXH,NSRSBH,NSRBM,NSRMC,FDDBRMC,FRZJLX_DM,ZJHM,SCJYDZ,BSRMC,DHHM,LSGX_DM,HY_DM,DJZCLX_DM,HZDJRQ,QYKJZD_DM,SWDJBLX_DM,SWDJZLX_DM,NSRZT_DM,ZGSWRY_DM,JDXZ_DM,ZZSNSRLX_DM,GSYLB_DM,NSRXYDJ_DM,QYGM_DM,CYLX_DM,XZQH_YSFPBL_DM,HGDM,ZJG_BZ,NSR_SWJG_DM,SWJG_DM,LRR_DM,LRRQ,XGR_DM,XGRQ,HDFS_DM,DSZ,NSRMC_JC,ZJL,QYFR_DM,FZDW_MC,FZHM,JYFS_DM,NSRLB_DM,GDGGBZ,KGFS_DM,HYDL_DM,BF_SJQYXZ_DM ");
            strSql.Append(" FROM DJ_NSRXX ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            strSql.Append(" order by " + filedOrder);
            return DbHelperOra.Query(strSql.ToString());
        }


        /*
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        {
            SqlParameter[] parameters = {
                    new SqlParameter("@tblName", SqlDbType.VarChar, 255),
                    new SqlParameter("@fldName", SqlDbType.VarChar, 255),
                    new SqlParameter("@PageSize", SqlDbType.Int),
                    new SqlParameter("@PageIndex", SqlDbType.Int),
                    new SqlParameter("@IsReCount", SqlDbType.Bit),
                    new SqlParameter("@OrderType", SqlDbType.Bit),
                    new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
                    };
            parameters[0].Value = "DJ_NSRXX";
            parameters[1].Value = "NSRDZDAH";
            parameters[2].Value = PageSize;
            parameters[3].Value = PageIndex;
            parameters[4].Value = 0;
            parameters[5].Value = 0;
            parameters[6].Value = strWhere;	
            return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
        }*/

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

